﻿using DTcms.Common;
using PayPal.PayPalAPIInterfaceService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml;

namespace DTcms.API.Payment.paypal
{
    public class PaypalConfig
    {
        private static Dictionary<string, string> config = PayPal.Manager.ConfigManager.Instance.GetProperties();

        static PaypalConfig()
        {
            config = PayPal.Manager.ConfigManager.Instance.GetProperties();
        }

        public static PayPalAPIInterfaceServiceService GetPayService()
        {
            return new PayPalAPIInterfaceServiceService(config);
        }

        public static string ReturnUrl = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + config["ReturnUrl"];
        public static string CancelUrl = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + config["CancelUrl"];
        public static string LogoUrl = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + config["LogoUrl"];
        public static string SellerEmail = config["SellerEmail"];
        public static string RedirectUrl = config["RedirectUrl"];
        public static string IPNEndpoint = config["IPNEndpoint"];



    }
}
